home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  27.1 KB  |  810 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Devices.h
  3.  
  4.      Contains:    Device Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DEVICES__
  19. #define __DEVICES__
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. #endif
  27. #ifndef __QUICKDRAW__
  28. #include <Quickdraw.h>
  29. #endif
  30. #ifndef __NAMEREGISTRY__
  31. #include <NameRegistry.h>
  32. #endif
  33. #ifndef __CODEFRAGMENTS__
  34. #include <CodeFragments.h>
  35. #endif
  36. #ifndef __DRIVERFAMILYMATCHING__
  37. #include <DriverFamilyMatching.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62. /* Values of the 'message' parameter to a Chooser device package */
  63.  
  64. enum {
  65.     chooserInitMsg                = 11,                            /* the user selected this device package */
  66.     newSelMsg                    = 12,                            /* the user made new device selections */
  67.     fillListMsg                    = 13,                            /* fill the device list with choices */
  68.     getSelMsg                    = 14,                            /* mark one or more choices as selected */
  69.     selectMsg                    = 15,                            /* the user made a selection */
  70.     deselectMsg                    = 16,                            /* the user canceled a selection */
  71.     terminateMsg                = 17,                            /* allows device package to clean up */
  72.     buttonMsg                    = 19                            /* the user selected a button */
  73. };
  74.  
  75.  
  76. /* Values of the 'caller' parameter to a Chooser device package */
  77.  
  78. enum {
  79.     chooserID                    = 1
  80. };
  81.  
  82.  
  83. /* Values of the 'message' parameter to a Monitor 'mntr' */
  84.  
  85. enum {
  86.     initMsg                        = 1,                            /*initialization*/
  87.     okMsg                        = 2,                            /*user clicked OK button*/
  88.     cancelMsg                    = 3,                            /*user clicked Cancel button*/
  89.     hitMsg                        = 4,                            /*user clicked control in Options dialog*/
  90.     nulMsg                        = 5,                            /*periodic event*/
  91.     updateMsg                    = 6,                            /*update event*/
  92.     activateMsg                    = 7,                            /*not used*/
  93.     deactivateMsg                = 8,                            /*not used*/
  94.     keyEvtMsg                    = 9,                            /*keyboard event*/
  95.     superMsg                    = 10,                            /*show superuser controls*/
  96.     normalMsg                    = 11,                            /*show only normal controls*/
  97.     startupMsg                    = 12                            /*code has been loaded*/
  98. };
  99.  
  100.  
  101. /* control codes for DeskAccessories */
  102.  
  103. enum {
  104.     goodbye                        = -1,                            /* heap being reinitialized */
  105.     killCode                    = 1,                            /* KillIO requested */
  106.     accEvent                    = 64,                            /* handle an event */
  107.     accRun                        = 65,                            /* time for periodic action */
  108.     accCursor                    = 66,                            /* change cursor shape */
  109.     accMenu                        = 67,                            /* handle menu item */
  110.     accUndo                        = 68,                            /* handle undo command */
  111.     accCut                        = 70,                            /* handle cut command */
  112.     accCopy                        = 71,                            /* handle copy command */
  113.     accPaste                    = 72,                            /* handle paste command */
  114.     accClear                    = 73                            /* handle clear command */
  115. };
  116.  
  117. /* Control/Status Call Codes */
  118.  
  119. enum {
  120.     drvStsCode                    = 8,                            /* status call code for drive status */
  121.     ejectCode                    = 7,                            /* control call eject code */
  122.     tgBuffCode                    = 8                                /* set tag buffer code */
  123. };
  124.  
  125. /* miscellaneous Device Manager constants */
  126.  
  127. enum {
  128.     ioInProgress                = 1,                            /* predefined value of ioResult while I/O is pending */
  129.     aRdCmd                        = 2,                            /* low byte of ioTrap for Read calls */
  130.     aWrCmd                        = 3,                            /* low byte of ioTrap for Write calls */
  131.     asyncTrpBit                    = 10,                            /* trap word modifier */
  132.     noQueueBit                    = 9                                /* trap word modifier */
  133. };
  134.  
  135. /* flags used in the driver header and device control entry */
  136.  
  137. enum {
  138.     dReadEnable                    = 0,                            /* set if driver responds to read requests */
  139.     dWritEnable                    = 1,                            /* set if driver responds to write requests */
  140.     dCtlEnable                    = 2,                            /* set if driver responds to control requests */
  141.     dStatEnable                    = 3,                            /* set if driver responds to status requests */
  142.     dNeedGoodBye                = 4,                            /* set if driver needs time for performing periodic tasks */
  143.     dNeedTime                    = 5,                            /* set if driver needs time for performing periodic tasks */
  144.     dNeedLock                    = 6                                /* set if driver must be locked in memory as soon as it is opened */
  145. };
  146.  
  147.  
  148. enum {
  149.     dNeedLockMask                = 0x4000,                        /* set if driver must be locked in memory as soon as it is opened */
  150.     dNeedTimeMask                = 0x2000,                        /* set if driver needs time for performing periodic tasks */
  151.     dNeedGoodByeMask            = 0x1000,                        /* set if driver needs to be called before the application heap is initialized */
  152.     dStatEnableMask                = 0x0800,                        /* set if driver responds to status requests */
  153.     dCtlEnableMask                = 0x0400,                        /* set if driver responds to control requests */
  154.     dWritEnableMask                = 0x0200,                        /* set if driver responds to write requests */
  155.     dReadEnableMask                = 0x0100                        /* set if driver responds to read requests */
  156. };
  157.  
  158.  
  159. /* run-time flags used in the device control entry */
  160.  
  161. enum {
  162.     dOpened                        = 5,                            /* driver is open */
  163.     dRAMBased                    = 6,                            /* dCtlDriver is a handle (1) or pointer (0) */
  164.     drvrActive                    = 7                                /* driver is currently processing a request */
  165. };
  166.  
  167.  
  168. enum {
  169.     drvrActiveMask                = 0x0080,                        /* driver is currently processing a request */
  170.     dRAMBasedMask                = 0x0040,                        /* dCtlDriver is a handle (1) or pointer (0) */
  171.     dOpenedMask                    = 0x0020                        /* driver is open */
  172. };
  173.  
  174.  
  175.  
  176. struct DRVRHeader {
  177.     short                             drvrFlags;
  178.     short                             drvrDelay;
  179.     short                             drvrEMask;
  180.     short                             drvrMenu;
  181.     short                             drvrOpen;
  182.     short                             drvrPrime;
  183.     short                             drvrCtl;
  184.     short                             drvrStatus;
  185.     short                             drvrClose;
  186.     unsigned char                     drvrName[1];
  187. };
  188. typedef struct DRVRHeader                DRVRHeader;
  189. typedef DRVRHeader *                    DRVRHeaderPtr;
  190. typedef DRVRHeaderPtr *                    DRVRHeaderHandle;
  191.  
  192. struct DCtlEntry {
  193.     Ptr                             dCtlDriver;
  194.     short                             dCtlFlags;
  195.     QHdr                             dCtlQHdr;
  196.     long                             dCtlPosition;
  197.     Handle                             dCtlStorage;
  198.     short                             dCtlRefNum;
  199.     long                             dCtlCurTicks;
  200.     GrafPtr                         dCtlWindow;
  201.     short                             dCtlDelay;
  202.     short                             dCtlEMask;
  203.     short                             dCtlMenu;
  204. };
  205. typedef struct DCtlEntry                DCtlEntry;
  206.  
  207. typedef DCtlEntry *                        DCtlPtr;
  208. typedef DCtlPtr *                        DCtlHandle;
  209.  
  210. struct AuxDCE {
  211.     Ptr                             dCtlDriver;
  212.     short                             dCtlFlags;
  213.     QHdr                             dCtlQHdr;
  214.     long                             dCtlPosition;
  215.     Handle                             dCtlStorage;
  216.     short                             dCtlRefNum;
  217.     long                             dCtlCurTicks;
  218.     GrafPtr                         dCtlWindow;
  219.     short                             dCtlDelay;
  220.     short                             dCtlEMask;
  221.     short                             dCtlMenu;
  222.     SInt8                             dCtlSlot;
  223.     SInt8                             dCtlSlotId;
  224.     long                             dCtlDevBase;
  225.     Ptr                             dCtlOwner;
  226.     SInt8                             dCtlExtDev;
  227.     SInt8                             fillByte;
  228.     UInt32                             dCtlNodeID;
  229. };
  230. typedef struct AuxDCE                    AuxDCE;
  231. typedef AuxDCE *                        AuxDCEPtr;
  232. typedef AuxDCEPtr *                        AuxDCEHandle;
  233. /*    The NDRV Driver IO Entry Point and Commands */
  234.  
  235. typedef UInt16                             UnitNumber;
  236. typedef UInt32                             DriverOpenCount;
  237. typedef SInt16                             DriverRefNum;
  238. typedef SInt16                             DriverFlags;
  239. typedef UInt32                             IOCommandCode;
  240.  
  241. enum {
  242.     kOpenCommand                = 0,
  243.     kCloseCommand                = 1,
  244.     kReadCommand                = 2,
  245.     kWriteCommand                = 3,
  246.     kControlCommand                = 4,
  247.     kStatusCommand                = 5,
  248.     kKillIOCommand                = 6,
  249.     kInitializeCommand            = 7,                            /* init driver and device*/
  250.     kFinalizeCommand            = 8,                            /* shutdown driver and device*/
  251.     kReplaceCommand                = 9,                            /* replace an old driver*/
  252.     kSupersededCommand            = 10,                            /* prepare to be replaced by a new driver*/
  253.     kSuspendCommand                = 11,                            /* prepare driver to go to sleep*/
  254.     kResumeCommand                = 12                            /* wake up sleeping driver*/
  255. };
  256.  
  257. typedef struct OpaqueAddressSpaceID*     AddressSpaceID;
  258. typedef struct OpaqueIOCommandID*         IOCommandID;
  259. typedef UInt32                             IOCommandKind;
  260.  
  261. enum {
  262.     kSynchronousIOCommandKind    = 0x00000001,
  263.     kAsynchronousIOCommandKind    = 0x00000002,
  264.     kImmediateIOCommandKind        = 0x00000004
  265. };
  266.  
  267.  
  268. struct DriverInitInfo {
  269.     DriverRefNum                     refNum;
  270.     RegEntryID                         deviceEntry;
  271. };
  272. typedef struct DriverInitInfo            DriverInitInfo;
  273. typedef DriverInitInfo *                DriverInitInfoPtr;
  274.  
  275. typedef DriverInitInfo                     DriverReplaceInfo;
  276. typedef DriverInitInfo *                DriverReplaceInfoPtr;
  277.  
  278. struct DriverFinalInfo {
  279.     DriverRefNum                     refNum;
  280.     RegEntryID                         deviceEntry;
  281. };
  282. typedef struct DriverFinalInfo            DriverFinalInfo;
  283. typedef DriverFinalInfo *                DriverFinalInfoPtr;
  284.  
  285. typedef DriverFinalInfo                 DriverSupersededInfo;
  286. typedef DriverFinalInfo *                DriverSupersededInfoPtr;
  287.  
  288. /* Contents are command specific*/
  289.  
  290.  
  291. union IOCommandContents {
  292.     ParmBlkPtr                         pb;
  293.     DriverInitInfoPtr                 initialInfo;
  294.     DriverFinalInfoPtr                 finalInfo;
  295.     DriverReplaceInfoPtr             replaceInfo;
  296.     DriverSupersededInfoPtr         supersededInfo;
  297. };
  298. typedef union IOCommandContents            IOCommandContents;
  299. typedef CALLBACK_API_C( OSErr , DriverEntryPointPtr )(AddressSpaceID SpaceID, IOCommandID CommandID, IOCommandContents Contents, IOCommandCode Code, IOCommandKind Kind);
  300. /* Record to describe a file-based driver candidate */
  301.  
  302. struct FileBasedDriverRecord {
  303.     FSSpec                             theSpec;                    /* file specification*/
  304.     MacDriverType                     theType;                    /* nameInfoStr + version number*/
  305.     Boolean                         compatibleProp;                /* true if matched using a compatible name*/
  306.     UInt8                             pad[3];                        /* alignment*/
  307. };
  308. typedef struct FileBasedDriverRecord    FileBasedDriverRecord;
  309. typedef FileBasedDriverRecord *            FileBasedDriverRecordPtr;
  310. /* Detailed Record to describe a file-based driver candidate. Includes fragment name */
  311.  
  312. struct FileBasedDriverDetailed {
  313.     FileBasedDriverRecord             fileBasedDriver;
  314.     Str63                             fragName;
  315. };
  316. typedef struct FileBasedDriverDetailed    FileBasedDriverDetailed;
  317. typedef FileBasedDriverDetailed *        FileBasedDriverDetailedPtr;
  318. /* Driver Loader API */
  319. #define DECLARE_DRIVERDESCRIPTION(N_ADDITIONAL_SERVICES)\
  320.         struct {\
  321.             DriverDescription    fixed;\
  322.             DriverServiceInfo    additional_service[N_ADDITIONAL_SERVICES-1];\
  323.         };
  324.  
  325.  
  326. EXTERN_API_C( SInt16 )
  327. HigherDriverVersion                (NumVersion *            driverVersion1,
  328.                                  NumVersion *            driverVersion2);
  329.  
  330. EXTERN_API_C( OSErr )
  331. VerifyFragmentAsDriver            (CFragConnectionID         fragmentConnID,
  332.                                  DriverEntryPointPtr *    fragmentMain,
  333.                                  DriverDescriptionPtr *    driverDesc);
  334.  
  335. EXTERN_API_C( OSErr )
  336. GetDriverMemoryFragment            (Ptr                     memAddr,
  337.                                  long                     length,
  338.                                  ConstStr63Param         fragName,
  339.                                  CFragConnectionID *    fragmentConnID,
  340.                                  DriverEntryPointPtr *    fragmentMain,
  341.                                  DriverDescriptionPtr *    driverDesc);
  342.  
  343. EXTERN_API_C( OSErr )
  344. GetDriverDiskFragment            (FSSpecPtr                 fragmentSpec,
  345.                                  CFragConnectionID *    fragmentConnID,
  346.                                  DriverEntryPointPtr *    fragmentMain,
  347.                                  DriverDescriptionPtr *    driverDesc);
  348.  
  349. EXTERN_API_C( OSErr )
  350. GetNamedDriverDiskFragment        (FSSpecPtr                 fragmentSpec,
  351.                                  ConstStr63Param         fragName,
  352.                                  CFragConnectionID *    fragmentConnID,
  353.                                  DriverEntryPointPtr *    fragmentMain,
  354.                                  DriverDescriptionPtr *    driverDesc);
  355.  
  356. EXTERN_API_C( OSErr )
  357. InstallDriverFromFragment        (CFragConnectionID         fragmentConnID,
  358.                                  RegEntryID *            device,
  359.                                  UnitNumber             beginningUnit,
  360.                                  UnitNumber             endingUnit,
  361.                                  DriverRefNum *            refNum);
  362.  
  363. EXTERN_API_C( OSErr )
  364. InstallDriverFromFile            (FSSpecPtr                 fragmentSpec,
  365.                                  RegEntryID *            device,
  366.                                  UnitNumber             beginningUnit,
  367.                                  UnitNumber             endingUnit,
  368.                                  DriverRefNum *            refNum);
  369.  
  370. EXTERN_API_C( OSErr )
  371. InstallDriverFromMemory            (Ptr                     memory,
  372.                                  long                     length,
  373.                                  ConstStr63Param         fragName,
  374.                                  RegEntryID *            device,
  375.                                  UnitNumber             beginningUnit,
  376.                                  UnitNumber             endingUnit,
  377.                                  DriverRefNum *            refNum);
  378.  
  379. EXTERN_API_C( OSErr )
  380. InstallDriverFromDisk            (Ptr                     theDriverName,
  381.                                  RegEntryID *            theDevice,
  382.                                  UnitNumber             theBeginningUnit,
  383.                                  UnitNumber             theEndingUnit,
  384.                                  DriverRefNum *            theRefNum);
  385.  
  386. EXTERN_API_C( OSErr )
  387. FindDriversForDevice            (RegEntryID *            device,
  388.                                  FSSpec *                fragmentSpec,
  389.                                  DriverDescription *    fileDriverDesc,
  390.                                  Ptr *                    memAddr,
  391.                                  long *                    length,
  392.                                  StringPtr                 fragName,
  393.                                  DriverDescription *    memDriverDesc);
  394.  
  395. EXTERN_API_C( OSErr )
  396. FindDriverForDeviceFromFile        (RegEntryID *            device,
  397.                                  FSSpec *                fragmentSpec,
  398.                                  DriverDescription *    driverDesc,
  399.                                  StringPtr                 fragName);
  400.  
  401. EXTERN_API_C( OSErr )
  402. FindDriverCandidates            (RegEntryID *            deviceID,
  403.                                  Ptr *                    propBasedDriver,
  404.                                  RegPropertyValueSize *    propBasedDriverSize,
  405.                                  StringPtr                 deviceName,
  406.                                  MacDriverType *        propBasedDriverType,
  407.                                  Boolean *                gotPropBasedDriver,
  408.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  409.                                  ItemCount *            nFileBasedDrivers);
  410.  
  411. EXTERN_API_C( OSErr )
  412. FindDriverCandidatesDetailed    (RegEntryIDPtr             deviceID,
  413.                                  Ptr *                    propBasedDriver,
  414.                                  RegPropertyValueSize *    propBasedDriverSize,
  415.                                  StringPtr                 deviceName,
  416.                                  MacDriverType *        propBasedDriverType,
  417.                                  Boolean *                gotPropBasedDriver,
  418.                                  FileBasedDriverDetailedPtr  fileBasedDrivers,
  419.                                  ItemCount *            nFileBasedDrivers);
  420.  
  421. EXTERN_API_C( OSErr )
  422. ScanDriverCandidates            (RegEntryID *            deviceID,
  423.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  424.                                  ItemCount                 nFileBasedDrivers,
  425.                                  FileBasedDriverRecordPtr  matchingDrivers,
  426.                                  ItemCount *            nMatchingDrivers);
  427.  
  428. EXTERN_API_C( OSErr )
  429. ScanDriverCandidatesDetailed    (RegEntryID *            deviceID,
  430.                                  FileBasedDriverDetailedPtr  fileBasedDrivers,
  431.                                  ItemCount                 nFileBasedDrivers,
  432.                                  FileBasedDriverDetailedPtr  matchingDrivers,
  433.                                  ItemCount *            nMatchingDrivers);
  434.  
  435. EXTERN_API_C( SInt16 )
  436. CompareFileCandToPropCand        (RegEntryID *            device,
  437.                                  StringPtr                 deviceName,
  438.                                  DriverTypePtr             propBasedCandidate,
  439.                                  FileBasedDriverRecordPtr  fileBasedCandidate);
  440.  
  441. EXTERN_API_C( void )
  442. GetCompatibleProperty            (RegEntryID *            device,
  443.                                  StringPtr *            compatibleNames,
  444.                                  ItemCount *            nCompatibleNames);
  445.  
  446. EXTERN_API_C( Boolean )
  447. CompatibleDriverNames            (StringPtr                 nameInfoStr,
  448.                                  StringPtr                 compatibleNames,
  449.                                  ItemCount                 nCompatibleNames,
  450.                                  long *                    nameCount);
  451.  
  452. EXTERN_API_C( OSErr )
  453. GetDriverForDevice                (RegEntryID *            device,
  454.                                  CFragConnectionID *    fragmentConnID,
  455.                                  DriverEntryPointPtr *    fragmentMain,
  456.                                  DriverDescriptionPtr *    driverDesc);
  457.  
  458. EXTERN_API_C( OSErr )
  459. InstallDriverForDevice            (RegEntryID *            device,
  460.                                  UnitNumber             beginningUnit,
  461.                                  UnitNumber             endingUnit,
  462.                                  DriverRefNum *            refNum);
  463.  
  464. EXTERN_API_C( OSErr )
  465. GetDriverInformation            (DriverRefNum             refNum,
  466.                                  UnitNumber *            unitNum,
  467.                                  DriverFlags *            flags,
  468.                                  DriverOpenCount *        count,
  469.                                  StringPtr                 name,
  470.                                  RegEntryID *            device,
  471.                                  CFragSystem7Locator *    driverLoadLocation,
  472.                                  CFragConnectionID *    fragmentConnID,
  473.                                  DriverEntryPointPtr *    fragmentMain,
  474.                                  DriverDescription *    driverDesc);
  475.  
  476. EXTERN_API_C( OSErr )
  477. GetDriverDescription            (LogicalAddress         fragmentPtr,
  478.                                  DriverDescriptionPtr *    theDriverDesc);
  479.  
  480. EXTERN_API_C( OSStatus )
  481. GetNamedDriverDescFromFSSpec    (FSSpecPtr                 fragmentSpec,
  482.                                  StringPtr                 fragName,
  483.                                  DriverDescriptionPtr *    driverDesc);
  484.  
  485. EXTERN_API_C( OSErr )
  486. SetDriverClosureMemory            (CFragConnectionID         fragmentConnID,
  487.                                  Boolean                 holdDriverMemory);
  488.  
  489. EXTERN_API_C( OSErr )
  490. ReplaceDriverWithFragment        (DriverRefNum             theRefNum,
  491.                                  CFragConnectionID         fragmentConnID);
  492.  
  493. EXTERN_API_C( OSErr )
  494. OpenInstalledDriver                (DriverRefNum             refNum,
  495.                                  SInt8                     ioPermission);
  496.  
  497. EXTERN_API_C( OSErr )
  498. RenameDriver                    (DriverRefNum             refNum,
  499.                                  StringPtr                 newDriverName);
  500.  
  501. EXTERN_API_C( OSErr )
  502. RemoveDriver                    (DriverRefNum             refNum,
  503.                                  Boolean                 immediate);
  504.  
  505. EXTERN_API_C( OSErr )
  506. LookupDrivers                    (UnitNumber             beginningUnit,
  507.                                  UnitNumber             endingUnit,
  508.                                  Boolean                 emptyUnits,
  509.                                  ItemCount *            returnedRefNums,
  510.                                  DriverRefNum *            refNums);
  511.  
  512. EXTERN_API_C( UnitNumber )
  513. HighestUnitNumber                (void);
  514.  
  515. EXTERN_API_C( OSErr )
  516. DriverGestaltOn                    (DriverRefNum             refNum);
  517.  
  518. EXTERN_API_C( OSErr )
  519. DriverGestaltOff                (DriverRefNum             refNum);
  520.  
  521. EXTERN_API_C( Boolean )
  522. DriverGestaltIsOn                (DriverFlags             flags);
  523.  
  524.  
  525. #if !OLDROUTINELOCATIONS
  526.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  527.                                                                                             #pragma parameter __D0 PBOpenSync(__A0)
  528.                                                                                             #endif
  529. EXTERN_API( OSErr )
  530. PBOpenSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA000);
  531.  
  532.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  533.                                                                                             #pragma parameter __D0 PBOpenAsync(__A0)
  534.                                                                                             #endif
  535. EXTERN_API( OSErr )
  536. PBOpenAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA400);
  537.  
  538.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  539.                                                                                             #pragma parameter __D0 PBOpenImmed(__A0)
  540.                                                                                             #endif
  541. EXTERN_API( OSErr )
  542. PBOpenImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA200);
  543.  
  544.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  545.                                                                                             #pragma parameter __D0 PBCloseSync(__A0)
  546.                                                                                             #endif
  547. EXTERN_API( OSErr )
  548. PBCloseSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA001);
  549.  
  550.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  551.                                                                                             #pragma parameter __D0 PBCloseAsync(__A0)
  552.                                                                                             #endif
  553. EXTERN_API( OSErr )
  554. PBCloseAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA401);
  555.  
  556.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  557.                                                                                             #pragma parameter __D0 PBCloseImmed(__A0)
  558.                                                                                             #endif
  559. EXTERN_API( OSErr )
  560. PBCloseImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA201);
  561.  
  562.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  563.                                                                                             #pragma parameter __D0 PBReadSync(__A0)
  564.                                                                                             #endif
  565. EXTERN_API( OSErr )
  566. PBReadSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA002);
  567.  
  568.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  569.                                                                                             #pragma parameter __D0 PBReadAsync(__A0)
  570.                                                                                             #endif
  571. EXTERN_API( OSErr )
  572. PBReadAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA402);
  573.  
  574.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  575.                                                                                             #pragma parameter __D0 PBReadImmed(__A0)
  576.                                                                                             #endif
  577. EXTERN_API( OSErr )
  578. PBReadImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA202);
  579.  
  580.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  581.                                                                                             #pragma parameter __D0 PBWriteSync(__A0)
  582.                                                                                             #endif
  583. EXTERN_API( OSErr )
  584. PBWriteSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA003);
  585.  
  586.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  587.                                                                                             #pragma parameter __D0 PBWriteAsync(__A0)
  588.                                                                                             #endif
  589. EXTERN_API( OSErr )
  590. PBWriteAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA403);
  591.  
  592.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  593.                                                                                             #pragma parameter __D0 PBWriteImmed(__A0)
  594.                                                                                             #endif
  595. EXTERN_API( OSErr )
  596. PBWriteImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA203);
  597.  
  598. EXTERN_API( void )
  599. AddDrive                        (short                     drvrRefNum,
  600.                                  short                     drvNum,
  601.                                  DrvQElPtr                 qEl);
  602.  
  603. EXTERN_API( QHdrPtr )
  604. GetDrvQHdr                        (void)                                                        THREEWORDINLINE(0x2EBC, 0x0000, 0x0308);
  605.  
  606. #endif  /*  !OLDROUTINELOCATIONS */
  607.  
  608. EXTERN_API( DCtlHandle )
  609. GetDCtlEntry                    (short                     refNum);
  610.  
  611. /*
  612.     SetChooserAlert used to simply set a bit in a low-mem global
  613.     to tell the Chooser not to display its warning message when
  614.     the printer is changed. However, under MultiFinder and System 7,
  615.     this low-mem is swapped out when a layer change occurs, and the
  616.     Chooser never sees the change. It is obsolete, and completely
  617.     unsupported on the PowerPC. 68K apps can still call it if they
  618.     wish.
  619.     
  620.     pascal Boolean SetChooserAlert(Boolean f);
  621.  
  622. */
  623.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  624.                                                                                             #pragma parameter __D0 DriverInstall(__A0, __D0)
  625.                                                                                             #endif
  626. EXTERN_API( OSErr )
  627. DriverInstall                    (DRVRHeaderPtr             drvrPtr,
  628.                                  short                     refNum)                                ONEWORDINLINE(0xA03D);
  629.  
  630.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  631.                                                                                             #pragma parameter __D0 DriverInstallReserveMem(__A0, __D0)
  632.                                                                                             #endif
  633. EXTERN_API( OSErr )
  634. DriverInstallReserveMem            (DRVRHeaderPtr             drvrPtr,
  635.                                  short                     refNum)                                ONEWORDINLINE(0xA43D);
  636.  
  637. /*
  638.   Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  639.           There will soon be a DriverInstall() which does the right thing.
  640.  
  641.         DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  642.         still exports DrvrRemove, so a macro is used to map the new name to old.
  643.  
  644. */
  645.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  646.                                                                                             #pragma parameter __D0 DrvrRemove(__D0)
  647.                                                                                             #endif
  648. EXTERN_API( OSErr )
  649. DrvrRemove                        (short                     refNum)                                ONEWORDINLINE(0xA03E);
  650.  
  651. #define DriverRemove(refNum) DrvrRemove(refNum)
  652.  
  653. #if TARGET_OS_MAC
  654.     #define MacOpenDriver OpenDriver
  655. #endif
  656. EXTERN_API( OSErr )
  657. MacOpenDriver                    (ConstStr255Param         name,
  658.                                  short *                drvrRefNum);
  659.  
  660. #if TARGET_OS_MAC
  661.     #define MacCloseDriver CloseDriver
  662. #endif
  663. EXTERN_API( OSErr )
  664. MacCloseDriver                    (short                     refNum);
  665.  
  666. EXTERN_API( OSErr )
  667. Control                            (short                     refNum,
  668.                                  short                     csCode,
  669.                                  const void *            csParamPtr);
  670.  
  671. EXTERN_API( OSErr )
  672. Status                            (short                     refNum,
  673.                                  short                     csCode,
  674.                                  void *                    csParamPtr);
  675.  
  676. EXTERN_API( OSErr )
  677. KillIO                            (short                     refNum);
  678.  
  679.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  680.                                                                                             #pragma parameter __D0 Fetch(__A1)
  681.                                                                                             #endif
  682. EXTERN_API( long )
  683. Fetch                            (DCtlPtr                 dce)                                THREEWORDINLINE(0x2078, 0x08F4, 0x4E90);
  684.  
  685.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  686.                                                                                             #pragma parameter __D0 Stash(__A1, __D0)
  687.                                                                                             #endif
  688. EXTERN_API( long )
  689. Stash                            (DCtlPtr                 dce,
  690.                                  char                     data)                                THREEWORDINLINE(0x2078, 0x08F8, 0x4E90);
  691.  
  692.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  693.                                                                                             #pragma parameter IODone(__A1, __D0)
  694.                                                                                             #endif
  695. EXTERN_API( void )
  696. IODone                            (DCtlPtr                 dce,
  697.                                  OSErr                     ioResult)                            THREEWORDINLINE(0x2078, 0x08FC, 0x4E90);
  698.  
  699.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  700.                                                                                             #pragma parameter __D0 PBControlSync(__A0)
  701.                                                                                             #endif
  702. EXTERN_API( OSErr )
  703. PBControlSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA004);
  704.  
  705.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  706.                                                                                             #pragma parameter __D0 PBControlAsync(__A0)
  707.                                                                                             #endif
  708. EXTERN_API( OSErr )
  709. PBControlAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA404);
  710.  
  711.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  712.                                                                                             #pragma parameter __D0 PBControlImmed(__A0)
  713.                                                                                             #endif
  714. EXTERN_API( OSErr )
  715. PBControlImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA204);
  716.  
  717.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  718.                                                                                             #pragma parameter __D0 PBStatusSync(__A0)
  719.                                                                                             #endif
  720. EXTERN_API( OSErr )
  721. PBStatusSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA005);
  722.  
  723.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  724.                                                                                             #pragma parameter __D0 PBStatusAsync(__A0)
  725.                                                                                             #endif
  726. EXTERN_API( OSErr )
  727. PBStatusAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA405);
  728.  
  729.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  730.                                                                                             #pragma parameter __D0 PBStatusImmed(__A0)
  731.                                                                                             #endif
  732. EXTERN_API( OSErr )
  733. PBStatusImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA205);
  734.  
  735.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  736.                                                                                             #pragma parameter __D0 PBKillIOSync(__A0)
  737.                                                                                             #endif
  738. EXTERN_API( OSErr )
  739. PBKillIOSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA006);
  740.  
  741.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  742.                                                                                             #pragma parameter __D0 PBKillIOAsync(__A0)
  743.                                                                                             #endif
  744. EXTERN_API( OSErr )
  745. PBKillIOAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA406);
  746.  
  747.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  748.                                                                                             #pragma parameter __D0 PBKillIOImmed(__A0)
  749.                                                                                             #endif
  750. EXTERN_API( OSErr )
  751. PBKillIOImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA206);
  752.  
  753. EXTERN_API( short )
  754. OpenDeskAcc                        (ConstStr255Param         deskAccName)                        ONEWORDINLINE(0xA9B6);
  755.  
  756. EXTERN_API( void )
  757. CloseDeskAcc                    (short                     refNum)                                ONEWORDINLINE(0xA9B7);
  758.  
  759. #if CGLUESUPPORTED
  760. EXTERN_API_C( short )
  761. opendeskacc                        (const char *            deskAccName);
  762.  
  763. EXTERN_API_C( OSErr )
  764. opendriver                        (const char *            driverName,
  765.                                  short *                refNum);
  766.  
  767. #endif  /* CGLUESUPPORTED */
  768.  
  769. /*
  770.     The PBxxx() routines are obsolete.  
  771.     
  772.     Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
  773. */
  774. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  775. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  776. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  777.  
  778. #if !OLDROUTINELOCATIONS
  779. #define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
  780. #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  781. #define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
  782. #define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))
  783. #endif  /*  !OLDROUTINELOCATIONS */
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790. #if PRAGMA_STRUCT_ALIGN
  791.     #pragma options align=reset
  792. #elif PRAGMA_STRUCT_PACKPUSH
  793.     #pragma pack(pop)
  794. #elif PRAGMA_STRUCT_PACK
  795.     #pragma pack()
  796. #endif
  797.  
  798. #ifdef PRAGMA_IMPORT_OFF
  799. #pragma import off
  800. #elif PRAGMA_IMPORT
  801. #pragma import reset
  802. #endif
  803.  
  804. #ifdef __cplusplus
  805. }
  806. #endif
  807.  
  808. #endif /* __DEVICES__ */
  809.  
  810.